package com.maixin.code.dao;

import java.util.List;


/**
 *
 * @author shujie
 *
 * @param <T>普通POJO对象
 */
public interface DAO<T>
{
    /**
     *
     * @param logInfo
     * @param t
     * @return
     * @throws Exception
     */
    public List<T> findAll(Class<T> t ,Integer start,Integer limit)
                    throws Exception;
    public List<T> findAll(Class<T> t );
    /**
     *
     * @param logInfo
     * @param t
     * @return
     * @throws Exception
     */
    public T save(T t )
           throws Exception;

    /**
     *
     * @param logInfo
     * @param t
     * @return
     * @throws Exception
     */
    public T update(T t )
             throws Exception;

    /**
     *
     * @param logInfo
     * @param t
     * @return
     * @throws Exception
     */
    public T delete(T t )
             throws Exception;

    /**
     *
     * @param logInfo
     * @param t
     * @return
     * @throws Exception
     */
    public T create(T t )
             throws Exception;
    
    public List<T> findByProperty(String property,Object value,Class<T> t)throws Exception;

    /**
     *
     * @param logInfo
     * @param propertes
     * @param values
     * @return
     */
    public List<T> findByPropertes(String[] propertes, Object[] values, Class<T> t )
                            throws Exception;
    
    public Integer findTabCnt(Class<T> t);
}
